<%--
  Created by IntelliJ IDEA.
  User: 若兮
  Date: 2021/12/26
  Time: 21:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>职位发布</title>
    <link rel="stylesheet" href="layui/css/layui.css">
</head>
<body class="layui-anim layui-anim-downbit">
<form class="layui-form" action="${pageContext.request.contextPath}/addJob" method="post">
    <div class="layui-form-item">
        <label class="layui-form-label">职位名称</label>
        <div class="layui-input-block">
            <input type="text" id="gname" name="gname" lay-verify="title" lay-reqtext="必填项，岂能为空？" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">职位详情</label>
        <div class="layui-input-block">
            <textarea class="layui-textarea" id="gwzz" name="gwzz" lay-verify="xq" lay-reqtext="必填项，岂能为空？"></textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">定员人数</label>
        <div class="layui-input-block">
            <input type="number" name="num" lay-verify="much" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">直接上级</label>
        <div class="layui-input-block">
            <select name="superior" id="superior" lay-verify="required">
                <option value="无">无</option>
                <option value="老板">老板</option>
                <option value="高级技工，高级工程师">高级技工，高级工程师</option>
                <option value="经理">经理</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">直接下属</label>
        <div class="layui-input-block">
            <select name="subordinates" id="subordinates" required lay-verify="required">
                <option value="无">无</option>
                <option value="高级技工，高级工程师">高级技工，高级工程师</option>
                <option value="经理">经理</option>
                <option value="高级技工">高级技工</option>
                <option value="普通员工">普通员工</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">学历要求</label>
        <div class="layui-input-block">
            <input type="checkbox" name="ask" title="大专" value="大专">
            <input type="checkbox" name="ask" title="本科" value="本科">
            <input type="checkbox" name="ask" title="硕士" value="硕士">
            <input type="checkbox" name="ask" title="博士" value="博士">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">薪资等级</label>
        <div class="layui-input-block">
            <input type="text" id="wages" name="wages" required lay-verify="required" lay-reqtext="必填项，岂能为空？" lay-verify="wage" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <input type="submit" class="layui-btn">
        </div>
    </div>
</form>
<script type="text/javascript" src="js/jquery-3.6.0.js"></script>
<script type="text/javascript" src="layui/layui.js"></script>
<script>
    layui.use(['form', 'layedit'], function () {
        var form = layui.form;
        //创建一个编辑器

        //自定义验证规则
        form.verify({
            title: function (value) {
                if (value.length < 2) {
                    return '至少得2个字符啊';
                }
            }
            , xq: function (value) {
                if (value.length < 2) {
                    return '至少得2个字符啊';
                }
            }
            , much: function (value) {
                if (value.length < 2) {
                    return '至少得2个字符啊';
                }
            }
            , wages: function (value) {
                if (value.length < 2) {
                    return '至少得2个字符啊';
                }
            }
        });
    });
</script>
</body>
</html>